package com.barks.learning.base.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @author chenw-i
 * @version 1.0.0
 * @ClassName CustomAspect.java
 * @Description TODO
 * @createTime 2020年07月11日 19:03:00
 */
@Aspect
@Component
public class CustomAspect {
    Logger logger = LoggerFactory.getLogger(CustomAspect.class);
    @Around("execution(* com.barks.learning.base.controller.*.*(..))")
    public Object aspectHandler(ProceedingJoinPoint pjp) throws Throwable {
        logger.info("aspectHandler before");
        Object obj = pjp.proceed();
        logger.info("aspectHandler after result : {}",obj);
        return obj;
    }
}
